//
//  LBQRAlertView.m
//  AFNetworking
//
//  Created by luckyRoy on 2018/1/12.
//

#import "LBQRAlertView.h"
#import <NSMutableAttributedString+Common.h>
#import <UIColor+LBColor.h>

@interface LBQRAlertView ()

@end

@implementation LBQRAlertView

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

+ (void)showByMessage:(NSString *)changeableMessage
             complete:(LBQRAlertViewBlock)complete;
{
    NSString *title = @"扫码成功";
    UIImage *image = [UIImage imageNamed:@"lb_QRCode_scan_success"];
    
//    NSString *changeStr = @"发包信息已保存在草稿箱";
    NSString *changeStr = changeableMessage;
    NSString *totalStr = [NSString stringWithFormat:@"请在web端上传文件\n\n%@",changeStr];
    LBAlertMessage *message = [[LBAlertMessage alloc]initType:LBAlertMessageTypeImageAttributedMessage];
    NSAttributedString *attributedMessage = [NSMutableAttributedString lb_getAttributedStringWithString:totalStr sub:changeStr color:[UIColor darkGray]];
    message.attributedMessage = attributedMessage;
    message.image = image;
    
    
    [[[[[[[LBAlertView new]addTitle:title]addHeaderImage:image]addMessage:message]addButtons:@[@"返回首页"]]addCompletedHander:^(NSInteger index){
        if (complete) {
            complete(index);
        }
    }]show];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
